package sword_to_1;

import node.TreeNode;

public class LeeCode_55 {
    public static void main(String[] args) {

    }
    private static int maxDepth(TreeNode root) {
        return dfs(root, 0);
    }
    private static int dfs(TreeNode node, int depth){
        if (node == null){
            return depth;
        }
        return Math.max(dfs(node.left, depth + 1), dfs(node.right, depth + 1));
    }
}
